Skip to content

nip46: show NIP-98 HTTP url/method in the bunker approval screen#417

Merged
kwsantiago merged 2 commits into
mainfrom
feat/nip46-http-auth-approval-render
Jul 15, 2026
Merged

nip46: show NIP-98 HTTP url/method in the bunker approval screen#417
kwsantiago merged 2 commits into
mainfrom
feat/nip46-http-auth-approval-render

Conversation

@kwsantiago

@kwsantiago kwsantiago commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes the keep-android follow-up from the NIP-98 over-broad-grant fix: the bunker approval screen did not show the HTTP URL/method being authorized.

NIP-98 (kind 27235) events carry empty content; the security-relevant u (URL) and method live in the event tags. The Rust signer core already surfaces these as BunkerApprovalRequest.httpAuth { url, method }, but Nip46ApprovalScreen never rendered them, so a user approving an HTTP-auth signature could not see which request they were authorizing.

This renders the URL and method in the approval details for kind-27235 requests, so HTTP-auth is not approved blind.

Changes

  • Nip46ApprovalScreen: new httpAuthUrl/httpAuthMethod params; when present, renders sanitized "HTTP URL" and "HTTP Method" detail rows (a missing tag reads as "Unspecified", per the Rust contract, rather than being hidden).
  • Nip46ApprovalActivity: passes request.httpAuth?.url / ?.method through.
  • String resources for the two labels and the unspecified placeholder.

The URL/method are already sanitized in the signer core and are re-sanitized for display (sanitizeDisplayContent).

Testing

  • Local: compileDebugKotlin, testDebugUnitTest, and lintDebug pass.

GH: #392

Summary by CodeRabbit

  • New Features
    • NIP-46 approval requests now display HTTP authentication details, including the request URL and method.
    • Unspecified HTTP methods are clearly labeled.
    • Displayed security-related values are sanitized before being shown.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kwsantiago, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0116d980-ee10-4415-a61b-2ba3ba410048

📥 Commits

Reviewing files that changed from the base of the PR and between 1176b72 and d8fc293.

📒 Files selected for processing (4)
  • app/src/main/kotlin/io/privkey/keep/nip46/Nip46ApprovalActivity.kt
  • app/src/main/kotlin/io/privkey/keep/nip46/Nip46ApprovalScreen.kt
  • app/src/main/kotlin/io/privkey/keep/nip46/Nip46UiComponents.kt
  • app/src/test/kotlin/io/privkey/keep/nip46/HttpAuthRowsTest.kt

Walkthrough

The NIP-46 approval flow now passes HTTP authentication URL and method data to the approval screen, sanitizes the values, and conditionally displays them with localized labels and an unspecified-method fallback.

Changes

NIP-46 HTTP authentication details

Layer / File(s) Summary
Approval HTTP auth details
app/src/main/kotlin/io/privkey/keep/nip46/Nip46ApprovalScreen.kt, app/src/main/kotlin/io/privkey/keep/nip46/Nip46ApprovalActivity.kt, app/src/main/res/values/strings_connections.xml
The activity passes optional HTTP auth values to the screen; the screen sanitizes and conditionally renders URL and method rows; string resources provide labels and the unspecified fallback.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: wksantiago

Poem

A rabbit hops through auth’s bright trail,
Showing URL and method details without fail.
Sanitized words in a tidy row,
With “Unspecified” when none can show.
NIP-46 approvals now softly glow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: surfacing NIP-98 HTTP URL and method on the bunker approval screen.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/nip46-http-auth-approval-render

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kwsantiago
kwsantiago merged commit ee232e3 into main Jul 15, 2026
4 checks passed
@kwsantiago
kwsantiago deleted the feat/nip46-http-auth-approval-render branch July 15, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant